package com.sgb.kjwl.viewmodel.self

import android.content.Context
import androidx.lifecycle.MutableLiveData
import com.sgb.kjwl.api.APIManager
import com.sgb.kjwl.model.entity.self.ApplyTypeData
import com.swgk.core.base.BaseViewModel
import com.swgk.core.base.api.ICallBack
import com.swgk.core.base.model.entity.BaseEntity
import com.swgk.core.dialog.DialogHelperNew

class ApprovalManagerViewModel : BaseViewModel() {

    val mApplyTypes = MutableLiveData<List<ApplyTypeData>>() //审批类型

    //审批二级类型
    fun getAgentApplyType(context: Context){
        APIManager.getInstance().userAPI.agentApplyType("jyb").enqueue(object :
            ICallBack<BaseEntity<List<ApplyTypeData>>>() {
            override fun onSuccess(data: BaseEntity<List<ApplyTypeData>>?) {
                if (data != null && data.data != null){
                   mApplyTypes.postValue(data.data)
                }
            }

            override fun onFail() {
                super.onFail()
            }
        })
    }
}